<?php
class ModelToolEasemob extends Model {
    
    
    private $easemob_options = array(
        'client_id'=>'YXA6e8On8L9LEeST63PaT5PWUQ',
        'client_secret'=>'YXA61BV0qJyO8VsvbGLzvHpfUtMBCbg',
        'org_name'=> 'sicifang',
        'app_name'=>'cook'
    );
    
    public function register($username,$password,$nickname)
    {
        $ease = new Easemob($this->easemob_options);
        $ease->register(array('username'=>$username,'password'=>$password,'nickname'=>$nickname));
    }
    
    public function setPassword($username,$password)
    {
        $ease = new Easemob($this->easemob_options);
        $ease->editPassword(array('username'=>$username,'newpassword'=>$password));
    }
    
    public function setNickname($username,$nickname)
    {
        $ease = new Easemob($this->easemob_options);
        $ease->nickname(array('username'=>$username,'nickname'=>$nickname));
    }
}